<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script>
function deleteSingle(byval)
{
	if(confirm("确认删除么？"))
	{
		document.getElementById(byval).checked=true;
		document.forms[0].action="/OpenAuthWebApplication/role/roleDeleteAction!delete.action?oper=delete";
		document.forms[0].submit();
	}
}
function updateSingle(byval)
{
	document.getElementById("roleId").value=byval;
	document.forms[0].action="/OpenAuthWebApplication/role/roleInitAction!init.action?oper=update";
	document.forms[0].submit();
}
</script>
<jsp:include page="/public/public.jsp"/>
</head>
<body>
<jsp:include page="/public/head.jsp"/>  
    <div class="wrapper clearfix">
    <jsp:include page="/public/left.jsp"/>  
	<div class="main">
<s:form name="role" action="roleAction.action" namespace="/role">

<table class="advert-tab" cellspacing="0">
<tr class="advert-th">
		<th colspan="6" style="text-align:left;">角色管理>>角色信息列表</th>
	</tr>
	<tr>
		<td >角色名称</td>
		<td ><input type="text" name="username" value="${roleName }"/></td>
		<td >角色描述</td>
		<td ><input type="text" name="roleDesc" value="${roleDesc }"/></td>
		<td >创建者ID</td>
		<td> <input type="text" name="createUserId" value="${createUserId }"/></td>
	</tr>
	<tr>
		<td >创建日期</td>
		<td ><input type="text" name="createDate" value="${createDate }"/></td>
		<td >最后更新日期</td>
		<td ><input type="text" name="updateDate" value="${updateDate }"/></td>
		<td colspan=3>
			<input type="submit"  value="查询"/>&nbsp;
			<input type="button" onclick="location.href='/OpenAuthWebApplication/role/roleInitAction!init.action?oper=save'" value="添加"/>&nbsp;
			
			<input type="button" value="删除"/>
			<input type="hidden" value="" name="roleId" id="roleId"/>
		</td>		
	</tr>
</table>
<table class="advert-tab" cellspacing="0">
	<s:if test="#request.list.size==0">
	<tr>
		<td colspan="6">
			没有需要显示的数据！
		</td>
	</tr>
	</s:if>
	<s:else>
<tr class="advert-th">
		<th>&nbsp;</th>
		<th>操作</th>
		<th>操作</th>
		<th>操作</th>
		<th>角色名称</th>
		<th>角色描述</th>
		<th>创建者ID</th>
		<th>创建日期</th>
		<th>最后更新日期</th>
	</tr>
	<s:iterator  value="#request.actionPageBean.data" id="role" status="rolelist">
	<tr>
		<td><input type="checkbox" name="roleIds" id="chk_<s:property value="#role.roleId" />" value="<s:property value="#role.roleId" />"/></td>
		
		<td><a href="/OpenAuthWebApplication/role/roledetailAction!detail.action?roleId=<s:property value="#role.roleId" />">明细</a></td>
		<td><a href="javascript:updateSingle('<s:property value="#role.roleId" />')">修改</a></td>
		<td><a href="javascript:deleteSingle('chk_<s:property value="#role.roleId" />')">删除</a></td>
		<td><s:property value="#role.roleName" />&nbsp;</td>
		<td><s:property value="#role.roleDesc" />&nbsp;</td>
		<td><s:property value="#role.createUserId" />&nbsp;</td>
		<td><s:property value="#role.createDate" />&nbsp;</td>
		<td><s:property value="#role.updateDate" />&nbsp;</td>
	</tr>
	</s:iterator>
	</s:else>
</table>

<table class="advert-tab" cellspacing="0">
<tr>
	<td>
		<input type="hidden" name="currentPageNo" value="${currentPageNo}"/>
		<input type="hidden" name="prevPageNo" value="${prevPageNo}"/>
		<input type="hidden" name="nextPageNo" value="${nextPageNo}"/>
		<input type="hidden" name="totalCount" value="${totalCount}"/>
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/role/roleAction!getFirstPage.action'" value="首 页"/>&nbsp;
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/role/roleAction!getPrevPage.action'" value="上一页"/>&nbsp;
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/role/roleAction!getNextPage.action'" value="下一页"/>&nbsp;
	</td>
	<td colspan=3>
		<input type="button" onclick="location.href='/OpenAuthWebApplication/role/roleAction!getLastPage.action'" value="末 页"/>&nbsp;
	</td>
</tr>
</table>

</s:form>
</div>
</div>
<%@ include file="/public/footer.jsp"%>
</body>
</html>